home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkimage.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  7.5 KB  |  225 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GTK_IMAGE_H__
  28. #define __GTK_IMAGE_H__
  29.  
  30.  
  31. #include <gdk/gdk.h>
  32. #include <gtk/gtkmisc.h>
  33.  
  34.  
  35. G_BEGIN_DECLS
  36.  
  37. #define GTK_TYPE_IMAGE                  (gtk_image_get_type ())
  38. #define GTK_IMAGE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_IMAGE, GtkImage))
  39. #define GTK_IMAGE_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMAGE, GtkImageClass))
  40. #define GTK_IS_IMAGE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_IMAGE))
  41. #define GTK_IS_IMAGE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMAGE))
  42. #define GTK_IMAGE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_IMAGE, GtkImageClass))
  43.  
  44.  
  45. typedef struct _GtkImage       GtkImage;
  46. typedef struct _GtkImageClass  GtkImageClass;
  47.  
  48. typedef struct _GtkImagePixmapData  GtkImagePixmapData;
  49. typedef struct _GtkImageImageData   GtkImageImageData;
  50. typedef struct _GtkImagePixbufData  GtkImagePixbufData;
  51. typedef struct _GtkImageStockData   GtkImageStockData;
  52. typedef struct _GtkImageIconSetData GtkImageIconSetData;
  53. typedef struct _GtkImageAnimationData GtkImageAnimationData;
  54. typedef struct _GtkImageIconNameData  GtkImageIconNameData;
  55.  
  56. struct _GtkImagePixmapData
  57. {
  58.   GdkPixmap *pixmap;
  59. };
  60.  
  61. struct _GtkImageImageData
  62. {
  63.   GdkImage *image;
  64. };
  65.  
  66. struct _GtkImagePixbufData
  67. {
  68.   GdkPixbuf *pixbuf;
  69. };
  70.  
  71. struct _GtkImageStockData
  72. {
  73.   gchar *stock_id;
  74. };
  75.  
  76. struct _GtkImageIconSetData
  77. {
  78.   GtkIconSet *icon_set;
  79. };
  80.  
  81. struct _GtkImageAnimationData
  82. {
  83.   GdkPixbufAnimation *anim;
  84.   GdkPixbufAnimationIter *iter;
  85.   guint frame_timeout;
  86. };
  87.  
  88. struct _GtkImageIconNameData
  89. {
  90.   gchar *icon_name;
  91.   GdkPixbuf *pixbuf;
  92.   guint theme_change_id;
  93. };
  94.  
  95. typedef enum
  96. {
  97.   GTK_IMAGE_EMPTY,
  98.   GTK_IMAGE_PIXMAP,
  99.   GTK_IMAGE_IMAGE,
  100.   GTK_IMAGE_PIXBUF,
  101.   GTK_IMAGE_STOCK,
  102.   GTK_IMAGE_ICON_SET,
  103.   GTK_IMAGE_ANIMATION,
  104.   GTK_IMAGE_ICON_NAME
  105. } GtkImageType;
  106.  
  107. struct _GtkImage
  108. {
  109.   GtkMisc misc;
  110.  
  111.   GtkImageType storage_type;
  112.   
  113.   union
  114.   {
  115.     GtkImagePixmapData pixmap;
  116.     GtkImageImageData image;
  117.     GtkImagePixbufData pixbuf;
  118.     GtkImageStockData stock;
  119.     GtkImageIconSetData icon_set;
  120.     GtkImageAnimationData anim;
  121.     GtkImageIconNameData name;
  122.   } data;
  123.  
  124.   /* Only used with GTK_IMAGE_PIXMAP, GTK_IMAGE_IMAGE */
  125.   GdkBitmap *mask;
  126.  
  127.   /* Only used with GTK_IMAGE_STOCK, GTK_IMAGE_ICON_SET, GTK_IMAGE_ICON_NAME */
  128.   GtkIconSize icon_size;
  129. };
  130.  
  131. struct _GtkImageClass
  132. {
  133.   GtkMiscClass parent_class;
  134.  
  135.   /* Padding for future expansion */
  136.   void (*_gtk_reserved1) (void);
  137.   void (*_gtk_reserved2) (void);
  138.   void (*_gtk_reserved3) (void);
  139.   void (*_gtk_reserved4) (void);
  140. };
  141.  
  142. #ifdef G_OS_WIN32
  143. /* Reserve old names for DLL ABI backward compatibility */
  144. #define gtk_image_new_from_file gtk_image_new_from_file_utf8
  145. #define gtk_image_set_from_file gtk_image_set_from_file_utf8
  146. #endif
  147.  
  148. GType      gtk_image_get_type (void) G_GNUC_CONST;
  149.  
  150. GtkWidget* gtk_image_new                (void);
  151. GtkWidget* gtk_image_new_from_pixmap    (GdkPixmap       *pixmap,
  152.                                          GdkBitmap       *mask);
  153. GtkWidget* gtk_image_new_from_image     (GdkImage        *image,
  154.                                          GdkBitmap       *mask);
  155. GtkWidget* gtk_image_new_from_file      (const gchar     *filename);
  156. GtkWidget* gtk_image_new_from_pixbuf    (GdkPixbuf       *pixbuf);
  157. GtkWidget* gtk_image_new_from_stock     (const gchar     *stock_id,
  158.                                          GtkIconSize      size);
  159. GtkWidget* gtk_image_new_from_icon_set  (GtkIconSet      *icon_set,
  160.                                          GtkIconSize      size);
  161. GtkWidget* gtk_image_new_from_animation (GdkPixbufAnimation *animation);
  162. GtkWidget* gtk_image_new_from_icon_name (const gchar     *icon_name,
  163.                      GtkIconSize      size);
  164.  
  165. void gtk_image_clear              (GtkImage        *image);
  166. void gtk_image_set_from_pixmap    (GtkImage        *image,
  167.                                    GdkPixmap       *pixmap,
  168.                                    GdkBitmap       *mask);
  169. void gtk_image_set_from_image     (GtkImage        *image,
  170.                                    GdkImage        *gdk_image,
  171.                                    GdkBitmap       *mask);
  172. void gtk_image_set_from_file      (GtkImage        *image,
  173.                                    const gchar     *filename);
  174. void gtk_image_set_from_pixbuf    (GtkImage        *image,
  175.                                    GdkPixbuf       *pixbuf);
  176. void gtk_image_set_from_stock     (GtkImage        *image,
  177.                                    const gchar     *stock_id,
  178.                                    GtkIconSize      size);
  179. void gtk_image_set_from_icon_set  (GtkImage        *image,
  180.                                    GtkIconSet      *icon_set,
  181.                                    GtkIconSize      size);
  182. void gtk_image_set_from_animation (GtkImage           *image,
  183.                                    GdkPixbufAnimation *animation);
  184. void gtk_image_set_from_icon_name (GtkImage        *image,
  185.                    const gchar     *icon_name,
  186.                    GtkIconSize      size);
  187. void gtk_image_set_pixel_size     (GtkImage        *image,
  188.                    gint             pixel_size);
  189.  
  190. GtkImageType gtk_image_get_storage_type (GtkImage   *image);
  191.  
  192. void       gtk_image_get_pixmap   (GtkImage         *image,
  193.                                    GdkPixmap       **pixmap,
  194.                                    GdkBitmap       **mask);
  195. void       gtk_image_get_image    (GtkImage         *image,
  196.                                    GdkImage        **gdk_image,
  197.                                    GdkBitmap       **mask);
  198. GdkPixbuf* gtk_image_get_pixbuf   (GtkImage         *image);
  199. void       gtk_image_get_stock    (GtkImage         *image,
  200.                                    gchar           **stock_id,
  201.                                    GtkIconSize      *size);
  202. void       gtk_image_get_icon_set (GtkImage         *image,
  203.                                    GtkIconSet      **icon_set,
  204.                                    GtkIconSize      *size);
  205. GdkPixbufAnimation* gtk_image_get_animation (GtkImage *image);
  206. void       gtk_image_get_icon_name (GtkImage              *image,
  207.                     G_CONST_RETURN gchar **icon_name,
  208.                     GtkIconSize           *size);
  209. gint       gtk_image_get_pixel_size (GtkImage             *image);
  210.  
  211. #ifndef GTK_DISABLE_DEPRECATED
  212. /* These three are deprecated */
  213.  
  214. void       gtk_image_set      (GtkImage   *image,
  215.                    GdkImage   *val,
  216.                    GdkBitmap  *mask);
  217. void       gtk_image_get      (GtkImage   *image,
  218.                    GdkImage  **val,
  219.                    GdkBitmap **mask);
  220. #endif /* GTK_DISABLE_DEPRECATED */
  221.  
  222. G_END_DECLS
  223.  
  224. #endif /* __GTK_IMAGE_H__ */
  225.